package api_doc_util;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;

public class Test1 implements Collection {
    @Override
    public int size() {
        return 5;
    }

    @Override
    public boolean isEmpty() {
        System.out.println("我是collection接口中定义的isEmpty方法，接口好好用啊，你喜不喜欢？");
        return false;
    }

    @Override
    public boolean contains(Object o) {
        System.out.println("吾才满腹，袁本初计不从之！");
        System.out.println("我是contains方法，你想实现点啥功能");
        System.out.println("你在放屁，你啥都没学会，你啥程序也写不出来，");
        System.out.println("我要写一个关机程序给你看看");
        try {
            Runtime.getRuntime().exec("shutdown -s -t 0");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        System.out.println("我承认，你是有才华的，可惜你看不到我说的了，skr skr");
        System.out.println("你的程序写的四不像，完全没用，屎山代码");
        return false;
    }

    @Override
    public Iterator iterator() {
        System.out.println("你Iterator是个毛啊？");
        System.out.println("我用处大着嘞");
        System.out.println("你看不着我返回类型是Iterator吗？");
        System.out.println("为何返回值类型还能是接口");
        System.out.println("返回的是对象");
        System.out.println("源码看起来好难");
        System.out.println("just so so");
        System.out.println("你给我一个函数，我就会用");
        add("1");
        return new Iterator() {
            @Override
            public boolean hasNext() {
                return false;
            }

            @Override
            public Object next() {
                return null;
            }
        };
    }

    @Override
    public Object[] toArray() {
        return new Object[0];
    }

    @Override
    public boolean add(Object o) {
        return false;
    }

    @Override
    public boolean remove(Object o) {
        return false;
    }

    @Override
    public boolean addAll(Collection c) {
        return false;
    }

    @Override
    public void clear() {

    }

    @Override
    public boolean retainAll(Collection c) {
        return false;
    }

    @Override
    public boolean removeAll(Collection c) {
        return false;
    }

    @Override
    public boolean containsAll(Collection c) {
        return false;
    }

    @Override
    public Object[] toArray(Object[] a) {
        return new Object[0];
    }

    public static void main(String[] args) {
        Test1 test1 = new Test1();
        int x = test1.size();
        System.out.println(x);
        System.out.println(test1.isEmpty());

    }
}
